<template>
  <div class="background">
    <div class="top">
      <img class="bgIMg" src="../../assets/img/applogo.png" alt="">
    </div>
    <div class="downBtn">
      <a :href="url1">
        <el-button type="primary" class="pdaButton">应用下载</el-button></a>
      <p>仅支持安卓操作系统</p>
      <p>暂不支持IOS下载</p>
    </div>
    <div v-if="isWeixin" class="appDialog">
      <img src="../../assets/img/zhezhaoceng.png" alt="">
    </div>
  </div>
</template>

<script>
// import api from "@/api";
// const { getApp } = api.app;
import axios from 'axios';
export default {
  data() {
    return {
      isWeixin: false,
      url1: '',
      url2: ''
    }
  },
  created() {
    //判断是否微信扫描
    let ua = navigator.userAgent;
    this.isWeixin = !!/MicroMessenger/i.test(ua);
    // this.download()
    this.getUrl()
  },
  methods: {
    // download(data) {
    //   this.url1 = 'https://oss.yukukeji.com/source/upload/2/20240816/3ae3235bb5634ec1b057acb78996ab5120240816162939465www101.apk'

    // },
    async getUrl() {
      const res = await axios.get(process.env.VUE_APP_BASE_API2 + '/updatePackage/selectUpdatePackage?appType=3')
      console.log('1111', res);
      if (res.data.code == 200) {
        console.log('', res.data.data);
        this.url1 = res.data.data.updateUrl
      }
    }
  }
}
</script>

<style scoped>
.top {
  height: 230px;
  display: flex;
  justify-content: center;
  /* margin-bottom: 20px; */
  padding-top: 50px;
}

.bgIMg {
  width: 160px;
  height: 160px;
}

.background {
  background-size: 100% 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.downBtn {
  flex: 1;
  width: 100%;
  height: 60%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.downBtn p {

  font-size: 12px;
  color: #8E8E8E;
}

.pdaButton {
  width: 250px;
  margin: 20px;
  border-radius: 200px;

}

.appDialog {
  height: 100%;
  width: 100%;
  position: fixed;
  background: rgba(0, 0, 0, 0.6);
  text-align: right;
  padding: 20px;
  /* padding-top: 50px; */
}

.appDialog img {
  width: 100%;
  height: 100%;
}
</style>